<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:include="base/head::head" />
<!--物理表信息-->
<body class="easyui-layout">
<div id="west_tool">
    <a href="#" class="icon-refresh" onclick="onRefreshDataList()"></a>
</div>
<div id="west" data-options="region:'west',split:true,title:'表列表',tools:'#west_tool'" style="width:150px;">
    <div id="list" class="easyui-datalist" data-options="url:'list',valueField:'tableName',textField:'tableDisplay',method:'get',fit:true,border:false,animate:true,onClickRow:onItemClick"></div>
</div>

<div id="center" region="center" data-options="title:'表信息'" style="overflow: hidden;">
    <form id="form" action="edit" method="post">
        <table>
            <tr>
                <td>表名称:</td>
                <td>
                    <input name="id" type="hidden"/>
                    <input name="tableName" class="easyui-textbox" data-options="required:true,editable:false,width:200"/></td>
                <td>显示名称:</td>
                <td><input name="tableDisplay" class="easyui-textbox" data-options="required:true,width:200,validType:'length[1,30]'"/></td>
            </tr>
            <tr>
                <td>类型:</td>
                <td>
                    <input name="tableType" class="easyui-textbox" data-options="required:true,editable:false,width:200"/>
                </td>
                <td>显示顺序:</td>
                <td><input name="showOrder" class="easyui-numberspinner" data-options="min:0,value:1,width:200"/></td>
            </tr>
            <tr>
                <td>是否显示:</td>
                <td>
                    <input name="isShow" class="easyui-combobox" data-options="data:Form.isShow,value:1,panelHeight:'auto',width:200"/>
                </td>
            </tr>
            <tr>
                <td>备注:</td>
                <td colspan="3">
                    <input name="tableComment" class="easyui-textbox" data-options="multiline:true,height:100,validType:'length[0,100]'" style="width: 100%;"/>
                </td>
            </tr>
            <tr>
                <td>
                    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="onSave()">保存</a>
                </td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript"  th:src="@{/utils/Form.js}"></script>
<script type="text/javascript">

    function onItemClick(index,node){
        $("#form").form("load",node);
    }

    function onRefreshDataList(){
        $("#list").datalist("reload");
        $("#form").form("clear");
    }

    function onSave(){
        $("#form").form("submit",{
            "success":function(data){
                console.log(data)
            }
        })
    }
</script>
</body>
</html>